package com.pvdnc.nsocket.serialize;

import java.nio.charset.StandardCharsets;

public class UTF8Encoding implements IEncoding {
    private static final String ENCODING_NAME="utf-8";

    @Override
    public int getSingleSize(){
        return getBytes("a").length;
    }

    @Override
    public String getString(byte[] data){
        return new String(data,StandardCharsets.UTF_8);
    }

    @Override
    public byte[] getBytes(String str){
        return str.getBytes(StandardCharsets.UTF_8);
    }
}
